curl --request POST \
--url http://localhost:5004/payments \
--header 'Content-Type: application/json' \
--data '{
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card"
}'
{
"success": true,
"errorMessage": null,
"payment": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card",
"status": "succeeded",
"errorCode": null,
"errorMessage": null,
"failureReason": null,
"createdAt": "2026-03-04T15:30:00Z",
"processedAt": "2026-03-04T15:30:02Z",
"isSimulated": true,
"simulatedResponse": "Success - TransactionId: txn_1234567890"
}
}
Process a payment for an order with validation and event-driven fulfillment
curl --request POST \
--url http://localhost:5004/payments \
--header 'Content-Type: application/json' \
--data '{
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card"
}'
{
"success": true,
"errorMessage": null,
"payment": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card",
"status": "succeeded",
"errorCode": null,
"errorMessage": null,
"failureReason": null,
"createdAt": "2026-03-04T15:30:00Z",
"processedAt": "2026-03-04T15:30:02Z",
"isSimulated": true,
"simulatedResponse": "Success - TransactionId: txn_1234567890"
}
}
Process a payment transaction for a customer order. This endpoint validates the order state, checks the reservation if provided, simulates the payment processing, and publishes events to Kafka for downstream services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JostinAlvaradoS/ticketing_project_week0/llms.txt
Use this file to discover all available pages before exploring further.
reservationId is providedpending statuspayment-succeeded or payment-failed event to KafkaorderId will return the existing successful payment if one exists, preventing duplicate charges.credit_card, debit_card, paypal, apple_pay, google_pay.success is false.Show payment properties
pending, succeeded, failed.INSUFFICIENT_FUNDS, CARD_DECLINED).{
"paymentId": "550e8400-e29b-41d4-a716-446655440000",
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card",
"transactionId": "txn_1234567890",
"processedAt": "2026-03-04T15:30:00Z",
"status": "succeeded"
}
{
"paymentId": "550e8400-e29b-41d4-a716-446655440000",
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card",
"errorCode": "INSUFFICIENT_FUNDS",
"errorMessage": "Card declined due to insufficient funds",
"failureReason": "The payment gateway returned error code 51",
"attemptedAt": "2026-03-04T15:30:00Z",
"status": "failed"
}
400 - Bad Request
orderId, customerId, amount){
"success": false,
"errorMessage": "Order validation failed: Order not found or doesn't belong to customer",
"payment": null
}
401 - Unauthorized
{
"success": false,
"errorMessage": "Unauthorized: Customer does not own this order",
"payment": null
}
404 - Not Found
{
"success": false,
"errorMessage": "Order not found",
"payment": null
}
422 - Unprocessable Entity
{
"success": false,
"errorMessage": "Payment failed: Card declined",
"payment": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "failed",
"errorCode": "CARD_DECLINED",
"errorMessage": "Card declined",
"failureReason": "Issuing bank rejected the transaction"
}
}
500 - Internal Server Error
{
"success": false,
"errorMessage": "Payment processing error: Database connection timeout",
"payment": null
}
curl --request POST \
--url http://localhost:5004/payments \
--header 'Content-Type: application/json' \
--data '{
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card"
}'
{
"success": true,
"errorMessage": null,
"payment": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"orderId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"customerId": "a8098c1a-f86e-11da-bd1a-00112444be1e",
"reservationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"amount": 150.00,
"currency": "USD",
"paymentMethod": "credit_card",
"status": "succeeded",
"errorCode": null,
"errorMessage": null,
"failureReason": null,
"createdAt": "2026-03-04T15:30:00Z",
"processedAt": "2026-03-04T15:30:02Z",
"isSimulated": true,
"simulatedResponse": "Success - TransactionId: txn_1234567890"
}
}
IPaymentSimulatorService interface (source code: services/payment/src/Application/Ports/IPaymentSimulatorService.cs) would be replaced with actual payment gateway integrations such as:
bc_payment schema for payment recordskafka:9092 for event publishingASPNETCORE_URLS=http://+:5004
ConnectionStrings__Default=Host=postgres;Port=5432;Database=ticketing;Username=postgres;Password=postgres;SearchPath=bc_payment
Kafka__BootstrapServers=kafka:9092